<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>xiarikui管理后台</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <link href="/Public/plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <link href="/Public/Admin/css/unify.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="/Public/images/favicon.ico" type="image/x-icon" />
    <script src="/Public/js/jQuery-2.1.4.min.js"></script>
    <script src="/Public/js/global.js"></script>
    <script src="/Public/js/myFormValidate.js"></script>
    <script src="/Public/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/Public/js/layer/layer-min.js"></script>
    <script src="/Public/js/myAjax.js"></script>
    <script type="text/javascript">
    function delfunc(obj) {
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: $(obj).attr('data-id')
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $(obj).parent().parent().remove();
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }

    //全选
    function selectAll(name, obj) {
        $('input[name*=' + name + ']').prop('checked', $(obj).checked);
    }

    function get_help(obj) {
        layer.open({
            type: 2,
            title: '',
            shadeClose: true,
            shade: 0.3,
            area: ['90%', '90%'],
            content: $(obj).attr('data-url')
        });
    }

    function delAll(obj, name) {
        var a = [];
        $('input[name*=' + name + ']').each(function(i, o) {
            if ($(o).is(':checked')) {
                a.push($(o).val());
            }
        });
        if (a.length == 0) {
            layer.alert('请选择删除项', {
                icon: 2
            });
            return;
        }
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'get',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: a
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $('input[name*=' + name + ']').each(function(i, o) {
                            if ($(o).is(':checked')) {
                                $(o).parent().parent().remove();
                            }
                        });
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }
    </script>
    <style type="text/css">
        .table > thead:first-child > tr:first-child > th{
            border-bottom: 0 none;
        } 
    </style>
</head>

<body>

<script type="text/javascript">
    window.UEDITOR_Admin_URL = "/Public/plugins/Ueditor/";
    var URL_upload = "<?php echo ($URL_upload); ?>";
    var URL_fileUp = "<?php echo ($URL_fileUp); ?>";
    var URL_scrawlUp = "<?php echo ($URL_scrawlUp); ?>";
    var URL_getRemoteImage = "<?php echo ($URL_getRemoteImage); ?>";
    var URL_imageManager = "<?php echo ($URL_imageManager); ?>";
    var URL_imageUp = "<?php echo ($URL_imageUp); ?>";
    var URL_getMovie = "<?php echo ($URL_getMovie); ?>";
    var URL_home = "<?php echo ($URL_home); ?>";
</script>
<script type="text/javascript" src="/Public/plugins/Ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/Public/plugins/Ueditor/ueditor.all.js"></script>
<link href="/Public/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="/Public/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="/Public/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
    <div class="breadcrumbs" id="breadcrumbs">
    <ol class="breadcrumb">
        <?php if(is_array($navigate_admin)): foreach($navigate_admin as $k=>$v): ?><li><?php echo ($k); ?></li><?php endforeach; endif; ?>
    </ol>
</div>

    <section class="content">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default pull-right" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>会计师信息</h3>
                </div>
                <div class="panel-body">
                    <form action="<?php echo U('accountant/handle');?>" method="post" >
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <td class="col-sm-1 text-right">用户名称:</td>
                                    <td>
                                        <input type="text" class="form-control" name="username" value="<?php echo ($info["username"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">用户登陆密码:</td>
                                    <td>
                                        <input type="text" class="form-control" name="password" value="">
                                    </td>
                                    <td>留空不修改</td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">设备号:</td>
                                    <td>
                                        <input type="text" class="form-control" name="registered_id" value="<?php echo ($info["registered_id"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">专业类型:</td>
                                    <td>
                                        <select name="cat_ids[]" class="form-control" multiple >
                                            <option value="">请选择</option>
                                            <?php if(is_array($cat_ids)): $i = 0; $__LIST__ = $cat_ids;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>" <?php if(in_array(($key), is_array($info["cat_ids"])?$info["cat_ids"]:explode(',',$info["cat_ids"]))): ?>selected<?php endif; ?> ><?php echo ($vo); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </select>
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">性别:</td>
                                    <td>
                                        <input name="sex" type="radio" value="0" <?php if($info['sex'] == 0): ?>checked<?php endif; ?> >保密
                                        <input name="sex" type="radio" value="1" <?php if($info['sex'] == 1): ?>checked<?php endif; ?> >男
                                        <input name="sex" type="radio" value="1" <?php if($info['sex'] == 2): ?>checked<?php endif; ?> >女
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">手机号:</td>
                                    <td>
                                        <input type="text" class="form-control" name="mobile" value="<?php echo ($info["mobile"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">是否验证手机:</td>
                                    <td>
                                        <input name="mobile_validated" type="radio" value="0" <?php if($info['mobile_validated'] == 0): ?>checked<?php endif; ?> >否
                                        <input name="mobile_validated" type="radio" value="1" <?php if($info['mobile_validated'] == 1): ?>checked<?php endif; ?> >是
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">悬赏金额:</td>
                                    <td>
                                        <input type="text" class="form-control" name="reward_money" value="<?php echo ($info["reward_money"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td class="col-sm-1 text-right">打赏金额:</td>
                                    <td>
                                        <input type="text" class="form-control" name="bonus_money" value="<?php echo ($info["bonus_money"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td class="col-sm-1 text-right">付费查看金额:</td>
                                    <td>
                                        <input type="text" class="form-control" name="charge_money" value="<?php echo ($info["charge_money"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td class="col-sm-1 text-right">提现金额:</td>
                                    <td>
                                        <input type="text" class="form-control" name="outcash_money" value="<?php echo ($info["outcash_money"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td class="col-sm-1 text-right">总采纳数:</td>
                                    <td>
                                        <input type="text" class="form-control" name="adoption_num" value="<?php echo ($info["adoption_num"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">单位:</td>
                                    <td>
                                        <input type="text" class="form-control" name="work_unit" value="<?php echo ($info["work_unit"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">职业证号:</td>
                                    <td>
                                        <input type="text" class="form-control" name="professional_num" value="<?php echo ($info["professional_num"]); ?>">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class = "text-right">职业证号图像:</td>
                                    <td>
                                        <img src="<?php echo ($info["professional_pic"]); ?>" width="100" height="100"/>
                                        <input type="text" id="professional_pic" readonly name="professional_pic" value="<?php echo ($info["professional_pic"]); ?>">
                                        <input type="button" class="button" onClick="GetUploadify(1, 'professional_pic', 'head_pic', '')" value="上传职业证号图像" />
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class = "text-right">头像:</td>
                                    <td>
                                        <img src="<?php echo ($info["head_pic"]); ?>" width="100" height="100"/>
                                        <input type="text" id="head_pic" readonly name="head_pic" value="<?php echo ($info["head_pic"]); ?>">
                                        <input type="button" class="button" onClick="GetUploadify(1, 'head_pic', 'head_pic', '')" value="上传头像照片" />
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class = "text-right">所在地址：</td>
                                    <td>
                                        省
                                        <select name="province" id="province" onchange="provinceCG(this.value)">
                                            <?php if(is_array($provinceList)): $i = 0; $__LIST__ = $provinceList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): $mod = ($i % 2 );++$i;?><option value="<?php echo ($list["id"]); ?>" <?php if($list[id] == $info[province]): ?>selected="selected"<?php endif; ?>><?php echo ($list["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </select>
                                        市
                                        <select name="city" id="city" >
                                            <?php if(is_array($cityList)): $i = 0; $__LIST__ = $cityList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): $mod = ($i % 2 );++$i;?><option value="<?php echo ($list["id"]); ?>" <?php if($list[id] == $info[city]): ?>selected="selected"<?php endif; ?>><?php echo ($list["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </select>

                                    </td>
                                </tr>



                                <tr>
                                <td class = "text-right">账户状态:</td>
                                <td>
                                    <input name="status" type="radio" value="0" <?php if($info['status'] == 0): ?>checked<?php endif; ?> >未审核
                            <input name="status" type="radio" value="1" <?php if($info['status'] == 1): ?>checked<?php endif; ?> >审核通过
                                    <input name="status" type="radio" value="2" <?php if($info['status'] == 2): ?>checked<?php endif; ?> >审核失败
                            </td>
                            <td>审核通过或失败 将会发送短信通知</td>
                            </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">审核失败原因:</td>
                                    <td>
                                        <input type="text" class="form-control" name="reason" value="">
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">年费到期时间:</td>
                                    <td>
                                        <input id="expired_time" type="text" class="form-control" name="expired_time" value='<?php echo (date("Y-m-d H:i:s",$info["expired_time"])); ?>'>

                                    </td>
                                    <td></td>
                                </tr>


                                <?php if(!empty($info[au_id])): ?><tr>
                                        <td class="col-sm-1 text-right">注册时间:</td>
                                        <td>
                                            <?php echo (date("Y-m-d H:i:s",$info["reg_time"])); ?>
                                        </td>
                                        <td></td>
                                    </tr><?php endif; ?>

                                <tr>
                                    <td></td>
                                    <td>
                                        <input type="hidden" value="<?php echo ($info["au_id"]); ?>" name="id" />
                                        <input type="hidden" value="<?php echo ($act); ?>" name="act" />
                                        <button type="submit" class="btn btn-info">
                                            <i class="ace-icon fa fa-check bigger-110"></i> 保存
                                        </button>
                                    </td>
                                </tr>
                            </table>

                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<script>

    $(document).ready(function () {

        $('#expired_time').daterangepicker({
            format : 'YYYY-MM-DD HH:mm:ss',
            singleDatePicker: true,
            showDropdowns: true,
            timePicker : true,
            timePicker12Hour : false,
            timePickerIncrement : 1, //时间的增量，单位为分钟
            minDate: '2017/08/01',
            maxDate: '2030/01/01',
            locale: {
                applyLabel: '确定',
                cancelLabel: '取消',
                fromLabel: '起始时间',
                toLabel: '结束时间',
                customRangeLabel: '自定义',
                daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
                monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                firstDay: 1
            }
        });
    });


    function provinceCG(id){
        if(id === '')
            return;
        province_id = id;
        $('#city').html('');
        if(id){
            $.ajax({
                type: "GET",
                url: "/index.php?m=Admin&c=user&a=getCityByAjax&province_id=" + id, //+tab,
                success: function (data)
                {
                    if (data)
                    {
                        var data=eval('('+data+')');
                        city = data.list;
                        city_html = '';
                        for(i=0;i<city.length;i++){
                            city_html +=
                                '<option value="'+city[i].id+'" >'+city[i].name+'</option>';
                        }
                        $("#city").html(city_html);
                    }
                }
            });
        }
    }

</script>
</body>

</html>